package com.thon.dao.project.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.thon.dao.project.ProjectBudgetDao;
import com.thon.dao.util.AbstractDao;
import com.thon.entity.project.ProjectBudget;
import com.thon.entity.project.ProjectSchedule;

/**
 * @file ProjectBudgetDaoImpl.java
 * @author Zemo
 * @mail zemochen@gmail.com
 * @data 2013年11月11日 下午5:06:32
 * @description: TODO
 */
@Repository
public class ProjectBudgetDaoImpl extends AbstractDao<ProjectBudget> implements ProjectBudgetDao {

	public ProjectBudgetDaoImpl() {
		super(ProjectBudget.class);
	}

	@Override
	public List<ProjectBudget> listProjectBudgets(int id) {
		String queryString = "FROM ProjectBudget pb WHERE pb.project.id = ?";
		return findList(queryString, null, id);
	}

	@Override
	public ProjectBudget getProjectBudget(Integer stage, Integer projectId) {
		
		String queryString ="FROM ProjectBudget  WHERE stage = ? AND project.id = ?";
		return findOne(queryString, null,stage,projectId);
	}

}
